package com.g8.pethospitallearnbackend.exception;

import com.g8.pethospitallearnbackend.utils.responseUtil.ResponseStatusEnum;
import lombok.Data;

/**
 * 自定义异常类
 */
@Data
public class CustomException extends RuntimeException{
    private int code = Integer.MIN_VALUE;
    private String exceptInfo;

    public CustomException(ResponseStatusEnum responseCode) {
        super(responseCode.getMsg());
        this.code = responseCode.getCode();
    }

    public CustomException(ResponseStatusEnum responseCode, String exceptInfo) {
        super(responseCode.getMsg());
        this.code = responseCode.getCode();
        this.exceptInfo = exceptInfo;
    }
}
